const jwt = require('jsonwebtoken');
const secretKey = 'oauthor-evan-1018';

/**
 * 生成 JWT
 */
function sign(payload, expiresIn = '1d') {
    return jwt.sign(payload, secretKey, {expiresIn});
}

// 验证 JWT

function verify(token) {
    return jwt.verify(token, secretKey)
}


module.exports = {
    sign,
    verify
}